insheet using ../Data/Raw/raw_pairwise_candidates.csv, comma names clear
keep if hmcharid1 == hmcharid2
g absorbconstant=1

gen pair_id=hiringmanagerid1+"-"+hiringmanagerid2
replace pair_id=hiringmanagerid2+"-"+hiringmanagerid1 if hiringmanagerid2>hiringmanagerid1
gen ratertwoeval=1

label var p_passinterview1 "\Centerstack{P(Passes\! Interview)\! Eval \#1}"
label var p_acceptinterview1 "\Centerstack{P(Accepts\! Interview)\! Eval \#1}"
label var p_acceptoffer1 "\Centerstack{P(Accepts\! Offer)\!Eval \#1}"
label var ratertwoeval "Second Evaluator"
replace ratertwoeval=p_acceptinterview2



************************************************************
* Table B.4: CROSS-VALIDATION OF EVALUATIONS OF CANDIDATES *
************************************************************

reghdfe p_acceptinterview1 ratertwoeval, absorb(absorbconstant) cluster(pair_id)
	eststo one 

replace ratertwoeval=p_passinterview2
reghdfe p_passinterview1 ratertwoeval, absorb(absorbconstant) cluster(pair_id)
	eststo three 

replace ratertwoeval=p_acceptoffer2
reghdfe p_acceptoffer1 ratertwoeval, absorb(absorbconstant) cluster(pair_id)
	eststo two 



global myopts "bf(%15.2gc) sfmt(%15.2gc) prehead(\begin{tabular}{l*{14}{c}}) postfoot(\end{tabular}) se label noisily noeqlines varlabels(_cons Constant, end("" ) nolast)  starlevels(* 0.1 ** 0.05 *** 0.01) replace"
esttab one two three using ../Output/Tables/Appendix/TableB04.tex, $myopts keep(ratertwoeval) stat(N r2, label("\hline Observations" \(R^{2}\)))
